﻿using Abp.Domain.Entities.Auditing;
using System;
using System.Collections.Generic;
using System.Text; 
using Abp.Domain.Repositories;
using System.Threading.Tasks;

namespace SFGX.Mango.ExpressPersons
{
	public class ExpressPersonManager  : IExpressPersonManager
	{
		private readonly IRepository<ExpressPerson> _expressPersonRepository;

		public ExpressPersonManager(IRepository<ExpressPerson>  expressPersonRepository)
		{
			_expressPersonRepository = expressPersonRepository;

		}

		public async Task BindMobile(ExpressPerson expressPerson)
		{
			await _expressPersonRepository.InsertAsync(expressPerson);
		}

		public async Task<ExpressPerson> GetAsync(string openId)
		{
		return	await _expressPersonRepository.FirstOrDefaultAsync(s=>s.OpenId==openId);
		}
	}
}
